import React, {useState} from 'react';
import Link from 'next/link';

export default () => {
  const [color, setColor] = useState('blue');

  return (
    <>
      <style jsx>
        {`
        h1 {color: ${color}}
      `}
      </style>

      <h1>jspang-b Page</h1>
      <button onClick={() => {
        setColor(color === 'blue' ? 'red' : 'blue')
      }}>改变颜色
      </button>
      <Link href='/'>
        <a>返回首页</a>
      </Link>
    </>
  )
}
